﻿﻿@{
    ViewBag.CurrentPage = WebApp.Common.PageSetting.DashboardPageSetting;
}

@{ var sectionId = (Request.IsAjaxRequest() ? "Ajax" : "View") + "_Dashboard"; }

@section Scripts{
    <script type="text/javascript">
        require(['Dashboard/Index'], function (api) {
            $(function () { api.exec('@sectionId'); });
        });
    </script>
    <script src="/Public/vendor/jquery.signalR.js"></script>
    <script src="http://localhost:9095/signalR/hubs"></script>

    <script>
        $(function () {
            var chat = $.connection.chatHub;

            // Turn logging on so we can see the calls in the browser console
            $.connection.hub.logging = true;

            // Change the hub url to point to the remote server
            $.connection.hub.url = 'http://localhost:9095/signalr';

            $.connection.hub.start().done(function () {
                $('#send').click(function () {
                    chat.server.send($('#msg').val());
                });
            });

            chat.client.addChatMessage = function (name, message, when) {
                $('#message').append('<li>' + name + '-' + message + '-' + when + '</li>');
            };
        });
    </script>

}

<div class="container" data-bind="stopbinding: true">
    <section id="@sectionId">
        <div>HOME PAGE TEXT</div>
    </section>

    <input type="text" id="msg" value=" " />
    <input type="button" id="send" value="send" />

    <ul id="message"></ul>

</div>
